﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" enableEventValidation='true' AutoEventWireup="true" CodeFile="adm_article_add.aspx.cs" Inherits="Admin_article_add" ValidateRequest='false' Title="Untitled Page" %>


<%@ Register assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagprefix="asp" %>


<%@ Register assembly="FredCK.FCKeditorV2" namespace="FredCK.FCKeditorV2" tagprefix="FCKeditorV2" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">

<script language="javascript" src="js/scw.js"></script>
<script language="javascript" src="js/MM_rollover.js"></script>
<script language="javascript" src="js/validate.js"></script>
<%--<script language="javascript" src="js/handler.js"></script>--%>

<script language="javascript" src="js/array.js"></script>
<script language="javascript" src="js/converttext.js"></script>
<script language="JavaScript" src="js/DynamicOptionList.js"></script>
<script src="js/vietUni.js" type="text/javascript"></script>

<style type="text/css">
        @import url(js/calendar-blue.css);
    </style>
    <script type='text/javascript' src="js/calendar.js"></script>
    <script type='text/javascript' src="js/calendar-en.js"></script>
    <script type='text/javascript' src="js/calendar-setup.js"></script>
 
<script language="javascript">
	function populateData(arr1, arr2, val){		
		var ar1 = arr1.split(",")
		var ar2 = arr2.split(",")
		var idx= ar1.indexOf(val.toString())
//		alert(idx + '=' + ar2[idx])
	}	
	function changeData(obj, idx){
//		obj.select;
	}
//	populateData("1,2,12,13", "1,2,13,14", 13)

function CheckMax(obj, len){
//	alert(obj.value.length)
	if (obj.value.length > len) return errorFound(obj, (obj.id !="" ? obj.id : obj.name) + " must have max character is "+len);
	return true;
}
function validate(theForm){
	if (!isValid(theForm)) return false;
	if (!CheckMax(theForm.rqkTitle_nss, 200))return false;
	//if (!CheckMax(theForm.kBody, 200))return false;
	return true;	
}
</script>

<script language="javascript">setTypingMode(2);</script>

<script language="JavaScript1.2">
<!--
var listsubcat = new DynamicOptionList('ctl00_ContentPlaceHolder2_ddlSubCat','ctl00_ContentPlaceHolder2_ddlCat');

function genListCatAuction()
{
	//Dynamic List Boxes 3 steps: 1.construct as below, 2.function init(), 3.body onload="init()"
				
	listsubcat.addOptions('8','Avatar Gợi Cảm','49','Avatar Nam','64','Avatar Thời Trang','63');
	listsubcat.setDefaultOption('8','49');		
					
	listsubcat.addOptions('29','Cẩm nang mua sắm','83','Mua sắm usa','81','Mua sắm Việt Nam','82');
	listsubcat.setDefaultOption('29','83');		
					
	listsubcat.addOptions('14','Báo thời trang thế giới','109','Báo thời trang Việt Nam','89');
	listsubcat.setDefaultOption('14','109');		
					
	listsubcat.addOptions('9','Blog biên tập','90','Giúp đỡ','54','Tư vấn','37','Tuyển dụng','30','Yêu cầu','91');
	listsubcat.setDefaultOption('9','90');		
					
	listsubcat.addOptions('39','Bông tai','102');
	listsubcat.setDefaultOption('39','102');		
					
	listsubcat.addOptions('21','Ca sĩ hải ngoại','73','Ca sĩ Nhật Bản','94','Ca sĩ thế giới','62','Ca sĩ Việt Nam','72');
	listsubcat.setDefaultOption('21','73');		
					
	listsubcat.addOptions('30','Công ty thời trang thế giới','86','Công ty thời trang Việt Nam','85','Đại lý ESECI','115');
	listsubcat.setDefaultOption('30','86');		
					
	listsubcat.addOptions('19','Diễn viên Đài Loan','58','Diễn viên Hàn Quốc','20','Diễn viên Hồng Kông','21','Diễn viên Nhật Bản','93','Diễn viên thế giới','61','Diễn viên Trung Quốc','22');
	listsubcat.setDefaultOption('19','58');		
					
	listsubcat.addOptions('36','Bao bì','119','Chụp hình studio','122','In lụa','118','Khắc la ze','121','May gia công','116','Nhãn','117','Thiết kế đồ họa','120');
	listsubcat.setDefaultOption('36','119');		
					
	listsubcat.addOptions('23','Hình nền gợi cảm','35','Hình nền nam','66','Hình nền thời trang','65');
	listsubcat.setDefaultOption('23','35');		
					
	listsubcat.addOptions('22','Hoa hậu Châu Á','74','Hoa hậu thế giới','60','Hoa hậu Việt Nam','75');
	listsubcat.setDefaultOption('22','74');		
					
	listsubcat.addOptions('5','Giải phẫu thẩm mỹ','14','Làm đẹp da mặt','45','Làm đẹp tóc','44','Mặc đẹp','11','Mỹ phẩm','13','Trang điểm','47');
	listsubcat.setDefaultOption('5','14');		
					
	listsubcat.addOptions('3','Người mẫu Hàn Quốc','57','Người mẫu thế giới','23','Người mẫu Việt Nam','78');
	listsubcat.setDefaultOption('3','57');		
					
	listsubcat.addOptions('27','Nhạc thời trang','88');
	listsubcat.setDefaultOption('27','88');		
					
	listsubcat.addOptions('35','Hạt cườm','134');
	listsubcat.setDefaultOption('35','134');		
					
	listsubcat.addOptions('2','Đồng hồ','18','Giầy dép','41','Kính mát','40','Mobile','17','Phụ trang khác','15','Trang sức','38','Túi xách','39');
	listsubcat.setDefaultOption('2','18');		
					
	listsubcat.addOptions('6','Giảm cân','43','Giáo dục giới tính','26','Phép lịch sự','24','Sức khoẻ','46','Tình yêu và hôn nhân','25');
	listsubcat.setDefaultOption('6','43');		
					
	listsubcat.addOptions('38','Tạp chí làm đẹp thế giới','112','Tạp chí làm đẹp Việt Nam','34');
	listsubcat.setDefaultOption('38','112');		
					
	listsubcat.addOptions('37','Máy đóng nút','133','Máy in lụa','123','Máy khắc CNC','126','Máy khắc la ze','127','Máy làm khuy','132','Máy may','129','Máy may kansai','130','Máy sấy hồng ngoại','125','Máy vắt sổ','131','Máy xi','128');
	listsubcat.setDefaultOption('37','133');		
					
	listsubcat.addOptions('12','Học thiết kế','107','Lịch sử thời trang','92','Mẩu thiết kế bạn đọc','108','Nhà thiết kế thế giới','106','Nhà thiết kế Việt Nam','67','Thi thiết kế','68');
	listsubcat.setDefaultOption('12','107');		
					
	listsubcat.addOptions('33','Thơ tình yêu','87');
	listsubcat.setDefaultOption('33','87');		
					
	listsubcat.addOptions('1','Áo cưới','4','Áo dài','36','Áo ngủ','32','Áo tắm','5','Cao cấp','1','Công sở','9','Đầm bầu','98','Đồ lót','6','Hàn Quốc','3','Hàng ngày','28','Hip-hop','53','Hồng kông','29','Show thời trang','42','Teen','52','Thể thao','51','Thể thao hàng ngày','97','Thời trang 70','55','Thời trang Nam','31','Thời trang tóc','12','Trẽ em','7','Trung niên','56','Xu hướng','2');
	listsubcat.setDefaultOption('1','4');		
					
	listsubcat.addOptions('41','Người mẩu trẻ','111','Nhà thiết kế trẻ','110');
	listsubcat.setDefaultOption('41','111');		
					
	listsubcat.addOptions('40','Dây chuyền','103','Nhẩn','105','Vòng đeo tay','104');
	listsubcat.setDefaultOption('40','103');		
					
	listsubcat.addOptions('34','Thun cotton','113','Thun Viscose','114');
	listsubcat.setDefaultOption('34','113');		
					
	listsubcat.addOptions('28','Dịch vụ thời trang','80','Sản phẩm thời trang','79');
	listsubcat.setDefaultOption('28','80');		
	
}
function init(idForm) {		// idForm is object form
	genListCatAuction();	
	listsubcat.init(idForm);
}

//-->
</script>


<script>
window.onload=myOnload();

function myOnload()
{

//init(document.aspnetForm);
document.getElementById("ctl00_ContentPlaceHolder2_txtTitleVN").focus();
}
</script>

			
			<div class="adm-wrap">
					<h3>Article
                    </h3>
					<div class="article">
						<p class="hi">&nbsp;<asp:Literal ID="ltrWellcome" runat="server"></asp:Literal>
                        </p>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
                            
                            <tr>
                                <td>&nbsp;</td>
                                <td>
                                    <table border='0' cellpadding="0" cellspacing='0'>
                                        <tr>
                                        <td><input type="radio" class="bogo" onfocus="setTypingMode(0)" value="0" name="optInput"/>Off</td>
                                        <td><input type="radio" class="bogo" onfocus="setTypingMode(1)" value="1" name="optInput"/>Telex</td>
                                        <td><input type="radio" class="bogo" checked="checked" onfocus="setTypingMode(2)" value="2" name="optInput"/>VNI</td>
                                        </tr>
                                    </table>
                                	
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Title-VN</td>
                                <td>
                                	<asp:TextBox ID="txtTitleVN" runat="server" CssClass="full"
                                	onkeyup="initTyper(this)" ></asp:TextBox>
                                	<%--<input class="submitbutton" name="commit" type="submit" value="Convert" />--%>
                                	<input type="button" onclick="return RemoveSign(ctl00$ContentPlaceHolder2$txtTitleVN.value,ctl00$ContentPlaceHolder2$txtTitleEN,true)" class="btnGo"
                                	 style="margin-bottom: 4px;" value="Convert" name="converttitle"/>
                                    </td>   
                            </tr>
                            <tr>
                                <td class="clstitle">Title-EN</td>
                                <td>
                                	<asp:TextBox ID="txtTitleEN" runat="server" CssClass="full"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Author</td>
                                <td>
                                	<asp:TextBox ID="txtAuthor" runat="server" CssClass="full"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Body-VN</td>
                                <td>
                                	<asp:TextBox ID="txtBodyVN" runat="server"  CssClass="full" Rows="6" 
                                        TextMode="MultiLine"
                                        onblur="removeCarriageReturn(this)" onkeyup="initTyper(this)" 
                                        Visible="False"></asp:TextBox>
                                   <%-- <input class="submitbutton" name="commit" type="submit" value="Convert" />--%>
                                    <FCKeditorV2:FCKeditor ID="fckBodyVN" runat="server" ToolbarSet="Basic">
                                    </FCKeditorV2:FCKeditor>
                                   <input type="button" onclick="return RemoveSign(ctl00$ContentPlaceHolder2$txtBodyVN.value,ctl00$ContentPlaceHolder2$txtBodyEN,true)" class="btnGo" 
                                   value="Convert" name="convertbody" style="margin-bottom: 4px;"/>
								</td>
                            </tr>
                            <tr>
                                <td class="clstitle">Body-EN</td>
                                <td>
                                	<asp:TextBox ID="txtBodyEN" runat="server" CssClass="full" Rows="6" 
                                        TextMode="MultiLine" Visible="False"></asp:TextBox>
								    <FCKeditorV2:FCKeditor ID="fckBodyEN" runat="server" ToolbarSet="Basic">
                                    </FCKeditorV2:FCKeditor>
								</td>
                            </tr>
                            <tr>
                                <td class="clstitle">Unique Keywords</td>
                                <td>
                                	<asp:TextBox ID="txtKeywords" runat="server" CssClass="full" Rows="6" 
                                        TextMode="MultiLine" ></asp:TextBox>
								</td>
                            </tr>
                            <tr>
                                <td class="clstitle">Main Category</td>
                                <td><%--onchange="listsubcat.populate()"--%><asp:DropDownList ID="ddlCat" runat="server" CssClass="medium" 
                                                 AutoPostBack="True" 
                                                onselectedindexchanged="ddlCat_SelectedIndexChanged">
                                            </asp:DropDownList>
                                    
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Sub Category</td>
                                <td>
                                            <asp:DropDownList ID="ddlSubCat" runat="server" CssClass="medium">
                                            </asp:DropDownList>
                                    
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Brand</td>
                                <td>
                                    <asp:TextBox ID="txtBrand" runat="server" CssClass="medium"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Country</td>
                                <td>
                                    <asp:DropDownList ID="ddlCountry" runat="server" CssClass="medium">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Year</td>
                                <td>
                                    <asp:DropDownList ID="ddlYear" runat="server" CssClass="medium">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Season</td>
                                <td>
                                    <asp:DropDownList ID="ddlSeason" runat="server" CssClass="medium">
                                        <asp:ListItem Value="1">Xuân - Hè</asp:ListItem>
                                        <asp:ListItem Value="2">Thu - Đông</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Publish date</td>
                                <td>
                                    <asp:TextBox ID="txtPubDate" runat="server" CssClass="medium"></asp:TextBox>
                                    &nbsp;<img src="../images/ico_calenda.gif" alt="thoi trang"  
                                    id='btnCalendar' style="cursor:pointer;" />
                <script type="text/javascript">
                      Calendar.setup(
                        {
                          inputField  : "ctl00_ContentPlaceHolder2_txtPubDate",         // ID of the input field
                          ifFormat    : "%Y - %m - %d ",    // the date format
                          button      : "btnCalendar"       // ID of the button
                        }
                      );
                    </script>
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Featured</td>
                                <td>
                                    <asp:DropDownList ID="ddlFeature" runat="server" CssClass="medium">
                                        <asp:ListItem Selected="True" Value="0">Regular</asp:ListItem>
                                        <asp:ListItem Value="1">Featured 1</asp:ListItem>
                                        
                                        <asp:ListItem Value="2">Featured 2</asp:ListItem>
                                        <asp:ListItem Value="3">Featured 3</asp:ListItem>
                                        <asp:ListItem Value="4">Featured 4</asp:ListItem>
                                        <asp:ListItem Value="5">Featured 5</asp:ListItem>
                                        
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Publish Satus</td>
                                <td>
                                    <asp:DropDownList ID="ddlPubStatus" runat="server" CssClass="medium">
                                        <asp:ListItem Selected="True" Value="0">Pending</asp:ListItem>
                                        <asp:ListItem Value="1">Approved</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td class="clstitle">Permission</td>
                                <td>
                                    <asp:DropDownList ID="ddlPermission" runat="server" CssClass="medium">
                                        <asp:ListItem Value="0">Public</asp:ListItem>
                                        <asp:ListItem Value="1">Private</asp:ListItem>
                                    </asp:DropDownList>
                               	</td>
                            </tr>
                            <tr>
                                <td class="clstitle">Layout Format</td>
                                <td>
                                    <asp:DropDownList ID="ddlLayoutFormat" runat="server" CssClass="medium">
                                        <asp:ListItem Value="0">Image and Image (Standard)</asp:ListItem>
                                        <asp:ListItem Value="1">Image and Text (Image left, Text right)</asp:ListItem>
                                        <asp:ListItem Value="2">Avatar (4 avatars per row)</asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>
                                    <asp:Button ID="btnAdd" runat="server" CssClass="submitbutton" 
                                        onclick="btnAdd_Click" Text="Add" CausesValidation="False" />
                                    <asp:Button ID="btnUpdate" Visible="false" runat="server" 
                                        CssClass="submitbutton"  Text="Update" Width="80px" 
                                        onclick="btnUpdate_Click" />
                                    <asp:Button ID="btnUploadImageDetail" Visible="false" runat="server" 
                                        CssClass="submitbutton"  Text="Update Detail Image" Width="140px" 
                                        onclick="btnUploadImageDetail_Click" />
                                </td>
                            </tr>
                            
                            <tr>
                                <td>&nbsp;</td>
                                <td>
                                    <asp:Label ID="lblErrorMessage" runat="server"></asp:Label>
                                </td>
                            </tr>
                            
                        </table>
                        
					</div>
				</div>


</asp:Content>

